<?php
/**
 * sap销售订单的处理
 * User: xiongjingyang
 * Date: 2019/5/16
 * Time: 10:49 AM
 */

namespace app\tasks\controller;
use app\common\YujisoController;

class Saporder extends YujisoController
{
    public $param;
    public function __construct()
    {
        parent::__construct();
        $temp = $this->request->param();
        if (isset($temp['s'])) unset($temp['s']);
        $this->param = $temp;
    }

     /**
     * 获取sap销售订单插入到yujiso
     * 每天凌晨两点更新
     * @author xiongjignyang
     */
    public function syncNewSapToYujiso()
    {
        set_time_limit(1800);
        ini_set('memory_limit', '500M');

        $orderJson=\app\index\service\StoresalesService::getSapOrders();
        returnJson();
    }
    /**
     * 生成店铺Sku销售报表
     * 每天凌晨四点更新
     * @author xiongjignyang
     */
    public function createStoreSkuReport()
    {
        set_time_limit(1800);
        ini_set('memory_limit', '500M');
        $orderReport=\app\index\model\StoresalesModel::saleReport();
        returnJson();
    }
     /**
     * 推送订单到店铺，生成出库单
     * @author xiongjignyang
     */
    public function pushShopWarehouseOut()
    {
        \app\index\service\StoresalesService::renewPushSapOrder();
        returnJson();
    }
}